﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace UnionPay4WP
{
    public interface IDES3
    {

        byte[] GenerateKey();

        /// <summary> 
        ///  用指定密钥对数据进行DES解密
        /// </summary>
        /// <param name="key">key[8] - 单倍长解密密钥</param>
        /// <param name="indata">	indata - 需要解密的密文数据，长度为8Byte</param>
        /// <param name="outdata">outdata- 解密后的明文数据，长度为8Byte</param>
        /// <returns>成功：true</returns>
        bool DesDecrypt(byte[] key, byte[] indata, out byte[] outdata);
        //int Des_Decrypt ( char key[8], char* indata,char *outdata);



        /// <summary> 
        ///  用指定密钥对数据进行DES加密
        /// </summary>
        /// <param name="key">key[8] - 单倍长解密密钥</param>
        /// <param name="indata">	indata - 需要加密的明文数据，长度为8Byte</param>
        /// <param name="outdata">outdata- 加密后的密文数据，长度为8Byte</param>
        /// <returns>成功：true</returns>
        bool DesEncrypt(byte[] key, byte[] indata, out byte[] outdata);
        //int Des_Encrypt ( char key[8], char*indata,char *outdata);


        /// <summary> 
        ///  用指定密钥对数据进行DES解密
        /// </summary>
        /// <param name="key">	key[16] - 双倍长加密密钥</param>
        /// <param name="indata">	indata - 需要解密的密文数据，长度为8Byte</param>
        /// <param name="outdata">outdata- 解密后的明文数据，长度为8Byte</param>
        /// <returns>成功：true</returns>
        bool DesTripleDecrypt(byte[] key, byte[] indata, out byte[] outdata);
        //int Des_TripleDecrypt(char key[16],char *indata,char *outdata);

        /// <summary> 
        ///  用指定密钥对数据进行DES加密
        /// </summary>
        /// <param name="key">	key[16] - 双倍长加密密钥</param>
        /// <param name="indata">	indata - 需要加密的明文数据，长度为8Byte</param>
        /// <param name="outdata">outdata- 解密后的密文数据，长度为8Byte</param>
        /// <returns>成功：true</returns>
        bool DesTripleEncrypt(byte[] key, byte[] indata, out byte[] outdata);
        //int Des_TripleEncrypt(char key[16],char *indata,char*outdata);


    }

}
